<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>path</title>
    <script src="./js/d3.min.js"></script>
    <script src="./js/d3-path.min.js"></script>
</head>
<style>
    path {
        fill: green;
        stroke: #aaa;
    }
</style>

<body>
    <!--
        M = moveto(M X,Y) ：将画笔移动到指定的坐标位置
        L = lineto(L X,Y) ：画直线到指定的坐标位置
        H = horizontal lineto(H X)：画水平线到指定的X坐标位置
        V = vertical lineto(V Y)：画垂直线到指定的Y坐标位置
        C = curveto(C X1,Y1,X2,Y2,ENDX,ENDY)：三次贝赛曲线
        S = smooth curveto(S X2,Y2,ENDX,ENDY)
        Q = quadratic Belzier curve(Q X,Y,ENDX,ENDY)：二次贝赛曲线
        T = smooth quadratic Belzier curveto(T ENDX,ENDY)：映射
        A = elliptical Arc(A RX,RY,XROTATION,FLAG1,FLAG2,X,Y)：弧线
        Z = closepath()：关闭路径
    -->
    <svg width="600" height="100">
        <path transform="translate(200, 0)" />
    </svg>
</body>
<script>
    var data = [[0, 0], [200, 30], [100, 50], [200, 60], [300, 90]];
    var lineGenerator = d3.line();
    var pathString = lineGenerator(data);
    console.log(pathString)
    d3.select('path').attr('d', pathString);
</script>

</html>